//package com.jiawa.train.business.mq;
//
//import com.alibaba.fastjson.JSON;
//import com.jiawa.train.business.dto.ConfirmOrderMQDto;
//import com.jiawa.train.business.service.ConfirmOrderService;
//import jakarta.annotation.Resource;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.slf4j.MDC;
//import org.springframework.stereotype.Service;
//
//@Service
//@Slf4j
//@RocketMQMessageListener(topic = "CONFIRM_ORDER",consumerGroup = "default")
//public class ConfirmOrderConsumer implements RocketMQListener<String> {
//
//    @Resource
//    private ConfirmOrderService   confirmOrderService;
//    @Override
//    public void onMessage(String msg) {
//        log.info("接收消息成功！");
//        //将字符串转为java对象
//        ConfirmOrderMQDto confirmOrderMQDto = JSON.parseObject(msg, ConfirmOrderMQDto.class);
//        //将日志id进行存储
//        MDC.put("LOG_ID",confirmOrderMQDto.getLogId());
//        log.info("接收到的消息为：{}", confirmOrderMQDto);
//        //进行调用核心的业务处理
//        confirmOrderService.doConfirmOrder(confirmOrderMQDto);
//    }
//}
